package com.explorati.interview.interview.chapterten;

import java.net.ServerSocket;
import java.net.Socket;

public class TCPServerB {

	public static void main(String[] args) throws Exception {
		// 用端口号创建一个ServerSocket对象
		ServerSocket ss = new ServerSocket(8888);
		// 开始循环监听来自客户端的请求
		Socket s = null;
		while ((s = ss.accept()) != null) {
			// 开始一个新的线程
			new MyThread(s).start();
		}
		ss.close();
	}
}
